<template>
  <div>
    <el-dialog :visible.sync="dialogVisible" :close-on-click-modal="false" title="导入数据详情" width="750px" @close="close">
      <div v-if="detail" class="dialog-import-detail">
        <el-form label-width="120px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="会员姓名：">{{ detail.name }}</el-form-item>
              <el-form-item label="会员类型：">{{ detail.memberType }}</el-form-item>
              <el-form-item label="绑定状态：">{{ detail.binded?"已绑定":"未绑定" }}</el-form-item>
              <el-form-item label="卡类型：">{{ detail.categoryName }}</el-form-item>
              <el-form-item label="性别：">{{ detail.sex?detail.sex:"未知" }}</el-form-item>
              <el-form-item label="手机号码：">{{ detail.phone }}</el-form-item>
              <el-form-item label="实充余额(元)：">{{ detail.balance|parseNumberToThousands(2,false) }}</el-form-item>
              <el-form-item label="赠送余额(元)：">{{ detail.giftBalance|parseNumberToThousands(2,false) }}</el-form-item>
              <el-form-item label="会员积分(个)：">{{ detail.points }}</el-form-item>
              <el-form-item label="推广员：">{{ detail.promoterName?detail.promoterName:"无" }}</el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所属门店：">{{ detail.registerShop?detail.registerShop:"无" }}</el-form-item>
              <el-form-item label="注册日期：">{{ detail.registerDate?detail.registerDate:"无" }}</el-form-item>
              <el-form-item label="出生日期：">{{ detail.birthday?detail.birthday:"无" }}</el-form-item>
              <el-form-item label="身份证号：">{{ detail.idCard?detail.idCard:"无" }}</el-form-item>
              <el-form-item label="个人邮箱：">{{ detail.email?detail.email:"无" }}</el-form-item>
              <el-form-item label="所在省份：">{{ detail.province?detail.province:"无" }}</el-form-item>
              <el-form-item label="所在地级市：">{{ detail.city?detail.city:"无" }}</el-form-item>
              <el-form-item label="个人学历：">{{ detail.education?detail.education:"无" }}</el-form-item>
              <el-form-item label="所在行业：">{{ detail.work?detail.work:"无" }}</el-form-item>
              <el-form-item label="个人爱好：">{{ detail.hobby?detail.hobby:"无" }}</el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      resolve: null,
      reject: null,
      detail: null,
      dialogVisible: null
    }
  },
  methods: {
    open(row) {
      this.detail = row
      this.show()
      return new Promise((resolve, reject) => {
        this.resolve = resolve
        this.reject = reject
      })
    },

    show() {
      this.dialogVisible = true
    },

    close() {
      this.detail = null
    },

    hide() {
      this.resolve = null
      this.reject = null
      this.dialogVisible = false
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
  .dialog-import-detail {
    padding-bottom: 20px;
    .el-form-item {
      margin-bottom: 0;
    }
    .el-row {
      .el-col:first-child {
        border-right: 1px solid #e7e7e7;
      }
    }
  }
</style>
